home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
disk_tools
/
mrbackup
/
docs
/
mrtape.doc
< prev
next >
Wrap
Text File
|
1995-03-05
|
9KB
|
173 lines
MRTape: SCSI Tape Handler V1.30
-------------------------------
Author: Mark R. Rinfret, MRsoftware
Date: 03/05/95
This is a tape handler designed primarily for MRBackup
Professional. Portions of this handler were originally derived
from code written by Markus Wandel and Bob Rethemeyer. I am very
grateful to them for their contributions to my understanding of
SCSI tape operations.
The MRTape-Handler is made accessible to the system by placing a
copy of its executable program in the L: directory, then
mounting it via an AmigaDOS mountlist entry (a sample appears
later in this document). The suggested device name is "MRTape:"
but you are free to call it anything that conforms to AmigaDOS
device naming conventions, since the name you choose for the
mountlist entry is the name given to the device entry.
The contents of a magnetic tape can be thought of as a series of
zero or more 'files', separated by 'file marks' (or tape marks,
if you prefer). Each time a program opens an MRTape-Handler
device for write access, a file mark is written at the end of
data when the device is eventually closed. Multiple 'files' can
be stacked on a given tape. These 'files' can also span multiple
physical tape cartridges. In this case, the individual tape
cartridges collectively appear as one very large tape cartridge.
Each of the 'files' on an MRTape-Handler created tape is numbered
consecutively from zero (0) through the number of files minus 1.
Each MRBackup saveset constitutes one tape file, though it
actually contains many AmigaDOS files and directories.
The MRTape-Handler's behavior when opening a tape can be altered
significantly by appending certain letter codes or a number after
the colon at the end of the device name. The various forms that
a tape name specification can take are as follows:
MRTape:
The tape is opened and rewound immediately.
MRTape:A
MRTape:AN
If the tape is opened for input (read access), it is just rewound.
If the tape is opened for output (write access), it is first
rewound, then positioned such that new data will be written after
all existing data on the tape. If 'A' is specified, the tape will
rewind when it is closed. If 'AN' is specified, the tape will not
rewind when it is closed. This mode is useful when you want to
append data to a tape which was previously written to and then
removed from the tape drive.
MRTape:N
The tape is opened and not rewound on opening or on closing.
A file mark will be written upon closing. This mode is useful
when writing multiple savesets to a single tape in one session
(the tape is not removed from the drive between sessions).
Almost all tape drives will rewind a tape cartridge when it
is inserted. Thus, MRTape:N can be used for all savesets
stacked in a single session.
MRTape:<number>
MRTape:<number>N
When the tape is opened for output, the <number> parameter
is ignored.
When the tape is opened for input, the handler will attempt
to position the tape to the beginning of the logical file
specified by <number> (a value from 0 to number-of-files minus 1).
If 'N' follows the number, the tape will not be rewound when
it is closed. Otherwise, the tape is rewound.
MRTape-Handler has been written to conform to the base SCSI standard
and should therefore be compatible with most tape drives which can be
used on the Amiga. There are bound to be exceptions to that general
rule, however. If you have difficulties, I'll do what I can to help.
I can provide a debug version of MRTape-Handler with a corresponding
monitor program which will report in excruciating detail on every
operation that MRTape-Handler performs. The information collected can
be analyzed and used to make adjustments (or a custom handler, if
necessary). I've also received reports of strange behavior on some
GVP SCSI interface cards in certain Amiga configurations.
The meaning of the word "handler" is significant in Amiga terms.
MRTape-Handler responds to standard AmigaDOS I/O packets (plus a few
custom packets which MRBackup will use if they are supported) and
attempts to present the same basic behavior that you would expect to
observe when accessing an AmigaDOS file. Implementing tape support
in this way (as opposed to embedding SCSI-direct calls within the
MRBackup Professional program) provides a large degree of device
independence for MRBackup Professional. MRBackup Pro simply writes a
stream of data (encoded in MRBackup's "FastDisk" format) to the Backup
Path.
Because of this high-level design choice, you can easily
substitute other handler-based tape drivers if you have a
particular preference or you're experiencing a problem with
MRTape-Handler. Excellent alternatives include Bob Rethemeyer's
BTNTape (Better Than Nothing Tape handler) and Matt Dillon's
DTape. There must be a few others by now.
MRBackup currently treats the backup set as one contiguous file.
Individual files have special header blocks and the data blocks
have control information which defines the end of each file.
There is a special control block to mark the end of tape. Thus,
the filemark isn't typically ever "read" and isn't required,
which is how the 3M drive (block-structured) is able to work.
The buffer size parameter in the Startup field of the mountlist
entry must be chosen with care. This is the size of 1 buffer (as
opposed to 1 block, as is typically specified for filesystems).
The handler allocates one buffer for synchronous I/O and two
buffers when using asynchronous I/O. For example, I reccommend 8
(8192 bytes) for the 3M drive (this is required by the drive) and
64 (65536 bytes) for the Wangtek 5150 ES. The Wangtek has a 64K
cache buffer. Setting MRTapeHandler to use 64K buffers causes
128K bytes to be allocated (a significant chunk!) but performance
is quite good. To obtain the best performance for other drives,
you may need to experiment. Use MRBackup Professional's
"Throughput" measurement as a relative guide to the effects that
changes in buffer sizes have on your backups.
Here is a sample mountlist entry for MRTape-Handler:
/* This is a mountlist entry for the SCSI tape handler provided with */
/* MRBackup. Pay particular attention to the StartUp message. Its */
/* format is: */
/* "<buffer_size>/<device_name>/<unit>/<luno>/<flags>" */
/* */
/* where */
/* <buffer_size> is the total amount of buffer memory, specified */
/* in K (K = 1024); */
/* */
/* <device_name> is the SCSI device driver name; */
/* */
/* <unit> is the SCSI unit number; */
/* */
/* <luno> is the SCSI logical unit number (not currently used but */
/* must be set to zero); */
/* */
/* <flags> is a set of bits controlling certain tape drive options */
/* The bit values, which may be added together are: */
/* */
/* 1 asynchronous mode, 0 = synchronous mode */
/* 2 use on-board buffer, 0 = don't use on-board buffer */
/* */
/* Example: to enable async mode and the on-board buffer, the */
/* <flags> value would be 3 (1 + 2). */
/* */
/* Other flag bits will be provided as new features are added. */
MRTAPE: Handler = l:mrtape-handler
StartUp = "64/scsi.device/4/0/3"
Stacksize = 4000
Priority = 10
GlobVec = -1
#
To determine the version number of MRTapeHandler, view the
handler with any binary file editor and look for a string that
begins with the letters "$VER:". You may also use the "version"
command under WorkBench 2.0.
To unload an instance of the MRTape: handler, just use the
Dismount option of the Assign command. Here's an example:
Assign DISMOUNT MRTape: